package com.drools.rule.entity;

public class DrlContext {

    private String drlPackage;
    private String drlImport;
    private String drlRuleId;
    private String dataExpires;
    private String activationGroup;
    private String salience;
    private String drlWhenAndThen;

    private DrlContext(String drlPackage,
                       String drlImport,
                       String drlRuleId,
                       String dataExpires,
                       String activationGroup,
                       String salience,
                       String drlWhenAndThen) {

        this.drlPackage = drlPackage;
        this.drlImport = drlImport;
        this.drlRuleId = drlRuleId;
        this.dataExpires = dataExpires;
        this.activationGroup = activationGroup;
        this.salience = salience;
        this.drlWhenAndThen = drlWhenAndThen;
    }

    public static class Builder {
        private String drlPackage;
        private String drlImport;
        private String drlRuleId;
        private String dataExpires;
        private String activationGroup;
        private String salience;
        private String drlWhenAndThen;

        public DrlContext build() {
            return new DrlContext(drlPackage, drlImport, drlRuleId, dataExpires, activationGroup, salience, drlWhenAndThen);
        }

        public Builder setDrlPackage(String drlPackage) {
            this.drlPackage = drlPackage;
            return this;
        }

        public Builder setDrlImport(String drlImport) {
            this.drlImport = drlImport;
            return this;
        }

        public Builder setDrlRuleId(String drlRuleId) {
            this.drlRuleId = drlRuleId;
            return this;
        }

        public Builder setDataExpires(String dataExpires) {
            this.dataExpires = dataExpires;
            return this;
        }

        public Builder setActivationGroup(String activationGroup) {
            this.activationGroup = activationGroup;
            return this;
        }

        public Builder setSalience(String salience) {
            this.salience = salience;
            return this;
        }

        public Builder setDrlWhenAndThen(String drlWhenAndThen) {
            this.drlWhenAndThen = drlWhenAndThen;
            return this;
        }
    }

    @Override
    public String toString() {
        return drlPackage
                + drlImport
                + drlRuleId
                + dataExpires
                + activationGroup
                + salience
                + drlWhenAndThen;
    }
}
